import React from 'react';
import Child from './Child'
export default class Lify extends React.Component{
    constructor(props) {
        super(props);
        this.state = {
            count:1
        }
    }
    dianji = () => {
        this.setState({
            count:this.state.count+1 
        })
    }
    render() {
        return (
            <div>
                <h1>React</h1>
                <button onClick={this.dianji}>点击哟下</button>
                <p>{this.state.count}</p>
                <Child name={this.state.count}/>
            </div>
        )
    }
}